package com.epta.common;

import java.util.EnumSet;

/**
 * Created by Administrator on 2017/6/21 0021.
 */
public enum AchievementStatus {
    NOT_COMMIT(0, "未提交"),
    NOT_AUDIT(1, "待审核"),
    REFUSE(2, "审核未通过"),
    ACCEPT(3, "已发布");
    private String value;
    private int code;

    AchievementStatus(int code, String description) {
        this.code = code;
        this.value = description;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValue(int code){
        for(AchievementStatus achievementStatus : EnumSet.allOf(AchievementStatus.class)){
            if(achievementStatus.getCode() == code){
                return achievementStatus.getValue();
            }
        }
        return null;
    }


}
